<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body th:fragment="base">
<form id="form1" th:action="@{/listName/saveOrUpdate}" method="post">
    <div class="setting_search tabs">
        <input type="hidden" name="id" th:value="${entity?.id}" id="entityId"/>
        <table class="table table-form">
            <thead>
            <tr>
                <td width="8%"></td>
                <td width="22%"></td>
                <td width="8%"></td>
                <td width="22%"></td>
                <td width="8%"></td>
                <td width="22%"></td>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td align="right"><span class="form-label">列表名称:</span></td>
                <td><input class="form-control" type="text" name="name" th:title="${entity?.name}" th:value="${entity?.name}"
                           placeholder="请输入"/></td>
            </tr>
            <tr>
                <td align="right"><span class="form-label">描述:</span></td>
                <td><input class="form-control" type="text" name="description" th:title="${entity?.description}"
                           th:value="${entity?.description}" placeholder="请输入"/></td>
            </tr>
            <tr>
                <td align="right"><span class="form-label">列表类型:</span></td>
                <td th:if="${entity?.id == null}">
                    <select class="form-control col-2" name="listType">
                        <option value="0" th:selected="${entity?.listType == 0}">普通列表</option>
                        <option value="1" th:selected="${entity?.listType == 1}">层叠列表</option>
                    </select>
                 </td>
                 <td th:if="${entity?.id != null}" style="vertical-align: middle;">
                    <input type="hidden" name="listType" th:value="${entity.listType}"/>
                    <span th:text="${entity?.listType == 0 ? '普通列表':'层叠列表'}">
			        </span>
                </td>
            </tr>
            <tr>
                <td align="right"><span class="form-label">apiName:</span></td>
                <td><input class="form-control" type="text" name="apiName" th:title="${entity?.apiName}"
                           th:value="${entity?.apiName}" placeholder="请输入"/></td>
            </tr>
            <tr>
                <td align="right"><span class="form-label">状态:</span></td>
                <td>
                    <select class="form-control col-2" name="enabled">
                        <option value="1" th:selected="${entity?.enabled == 1}">启用</option>
                        <option value="0" th:selected="${entity?.enabled == 0}">禁用</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td colspan="5">
                    <a href="javascript:void(0);" class="btn btn-primary" onclick="saveListName()">保存</a>
                    <a href="javascript:void(0);" class="btn btn-default border-blue" style="margin-left:15px;"
                       id="btnBack">返回</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</form>
</body>
</html>